


export default class SortLayer {



    constructor(sid, type, name, layer,preSourceId) {
        this.sid = sid;
        this.name = name;
        this.type = type;
        this.layer = layer;
        this.preSourceId = preSourceId;
        this.data = undefined;
        
    }

   //获取自定义图层
    getLayer(){
        return this.layer;
    }
   
    //是否可以点击
    setClickable(clickable){
        this.clickable = clickable;
    }

    isClickable(){
        return this.layer && this.layer.attribute && this.layer.attribute!="";
    }

    //获取类型
    getType() {
        return this.type;
    }

    //记录超图数据
    setSuperMapData(data){
        this.data = data;
    }

    //获取超图数据
    getSuperMapData(){
        return this.data;
    }

    //获取source-layer
    getSourceLayerName(){
       var layers =  this.data && this.data.layers.filter(i=>i['source-layer']);
       return layers.length > 0 && layers[0]['source-layer'];
    }

    
    setGeoJsonData(geojson){
        this.geojson = geojson;
    }


    getGeoJsonData(){
        return this.geojson;
    }


}